package com.gitee.swsk33.multidatademo.api;

import com.gitee.swsk33.multidatademo.dao.CatDAO;
import com.gitee.swsk33.multidatademo.dataobject.Cat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/cat")
public class CatAPI {

	@Autowired
	private CatDAO catDAO;

	@GetMapping("/get/{id}")
	public Cat getById(@PathVariable int id) {
		return catDAO.selectById(id);
	}

}